package com.beamfield.dao.sys;

import java.util.List;

import org.apache.ibatis.annotations.Param;
import org.springframework.stereotype.Component;

import com.beamfield.model.ManagerInfo;
import com.beamfield.model.ManagerInfoExample;
import com.beamfield.model.NormalOperator;
import com.beamfield.modelVo.ManagerTrainVo;
import com.beamfield.modelVo.UserAttendVo;

@Component
public interface ManagerInfoMapper {
    int deleteByPrimaryKey(Long manager_id);

    int insert(ManagerInfo record);

    int insertSelective(ManagerInfo record);

    List<ManagerInfo> selectByExample(ManagerInfoExample example);

    /**
     * 查找管理员信息列表并翻译
     * @param offset
     * @param limit
     * @param identity
     * @param name
     * @param beam_id
     * @param workdept
     * @param unit
     * @param presasg
     * @return
     */
    List<ManagerInfo> selectManagerInfoList(@Param("offset") Integer offset, @Param("limit") Integer limit, @Param("identity") String identity, @Param("name") String name, @Param("beam_id") Long beam_id, @Param("workdept") String workdept, @Param("unit") String unit,@Param("presasg") String presasg);

    int countList(@Param("identity") String identity, @Param("name") String name, @Param("beam_id") Long beam_id, @Param("workdept") String workdept, @Param("unit") String unit,@Param("presasg") String presasg);

    ManagerInfo selectByPrimaryKey(Long manager_id);

    int updateByPrimaryKeySelective(ManagerInfo record);

    int updateByPrimaryKey(ManagerInfo record);

	Integer selectCountByExample(ManagerInfoExample example);

	List<ManagerTrainVo> getDetailManagerTrainList(
			@Param("offset")Integer offset,
			@Param("limit")Integer limit,
			@Param("manager_id")Long manager_id);

	Integer getDetailManagerTrainCount(Long manager_id);

	Integer getCount();

    List<ManagerInfo> selectAllOperator(@Param("beamId") long beamId, @Param("workdept") String workdept, @Param("group") String group, @Param("type") String type, @Param("offset") String offset,@Param("limit") String limit);

    Long countAllOperator(@Param("beamId") long beamId, @Param("workdept") String workdept, @Param("group") String group, @Param("type") String type);

	Integer checkCountManagerInfoIDCard(
			@Param("identity")String identity,
			@Param("manager_id")Long manager_id);

    List<String> selectPresasgDistinct(@Param("beamId") Long beamId,@Param("type") String type);

    List<NormalOperator> mergeOperatorList(@Param("offset") Integer offset,
                                           @Param("limit") Integer limit,
                                           @Param("ecode") String ecode,
                                           @Param("name") String name,
                                           @Param("beam_id") Long beam_id,
                                           @Param("presasg") String presasg,
                                           @Param("group") String group);

    Long countMergeOperatorList(
                                @Param("ecode") String ecode,
                                @Param("name") String name,
                                @Param("beam_id") Long beam_id,
                                @Param("presasg") String presasg,
                                @Param("group") String group);

    List<ManagerInfo> getAllOperatorAttendList(@Param("offset")Integer offset, @Param("limit")Integer limit, @Param("name")String name,@Param("beam_id") Long beam_id,@Param("workdept")String workdept);

    Integer getCountByBeamId(@Param("beamId") Long beamId);

    Integer countTrain(@Param("beamId") Long beamId);

    Integer countManagerTrain(@Param("beamId") Long beamId);

    Integer countOperator(@Param("beamId") Long beamId);

    Integer countOperatorToTrain(@Param("beamId") Long beamId);

    Integer countOperatorNotToTrain(@Param("beamId") Long beamId);

    ManagerInfo selectByCodeAndBeamId(@Param("beam_id") Long beamId,@Param("ecode") String ecode);

    List<ManagerInfo> countByGroup(@Param("beam_id") Long beamId);

    List<String> selectEcodeByName(@Param("name") String dwEnrollName,@Param("beamId") Long beamId);

    List<UserAttendVo> selectAllUser(@Param("beam_id")Long beamId,@Param("name")String name,@Param("workdept")String workdept,@Param("offset")Integer offset,@Param("limit")Integer limit);
    List<ManagerInfo> selectAllUserWithPresasg(@Param("beam_id")Long beamId,@Param("name")String name,@Param("presasg")String presasg,@Param("offset")Integer offset,@Param("limit")Integer limit);

    Integer getAllUserTotal(@Param("beam_id")Long beamId,@Param("name")String name,@Param("workdept")String workdept);
    Integer getAllUserTotalWithPresasg(@Param("beam_id")Long beamId,@Param("name")String name,@Param("presasg")String presasg);

    NormalOperator getOperatorByecode(@Param("beam_id")Long beamId,@Param("ecode") String ecode);

    Integer countOperatorByType(@Param("beamId") Long beamId,@Param("type") String type);

    List<ManagerInfo> selectManagerOperator(@Param("beamId") Long beamId,@Param("workdept") String workdept,@Param("offset") String offset,@Param("limit") String limit);

    Long countManagerOperator(@Param("beamId") Long beamId,@Param("workdept") String workdept);

    List<ManagerInfo> selectAllLaborer(@Param("beamId") Long beamId,@Param("group") String group,@Param("offset") String offset,@Param("limit") String limit);

    Long countAllLaborer(@Param("beamId") Long beamId,@Param("group") String group);

    Integer checkCountManagerInfoName(@Param("name") String name, @Param("manager_id") Long manager_id,@Param("beamId") Long beam_id);

    Long getPeopleIdByEcode(@Param("ecode")String ecode);

    List<String> getFirstReviewerNames(@Param("group") String group, @Param("presasg")String presasg, @Param("beamId") Long beamId);

    List<String> getSecondOrThirdReviewerNames(@Param("step") Integer step, @Param("sequence") Integer sequence, @Param("beamId") Long beamId);

	Integer getManagerSort(@Param("type")Integer type, @Param("beamId") Long beamId);

	ManagerInfo getLatestSort(@Param("beamId")Long beam_id, @Param("type")Integer type, @Param("sort")Integer sort);

	int updateSort(@Param("beamId")Long beam_id, @Param("type")Integer type, @Param("sort")Integer sort);
}
